home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Objects / Invisibles / Anchor.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  723 b   |  27 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved
  2.  
  3. //---------------   GLOBAL VARIABLES   ---------------
  4.  
  5. var helpDoc = MM.HELP_objAnchor;
  6.  
  7. //---------------     API FUNCTIONS    ---------------
  8.  
  9. function initUI() {
  10.   var curDOM = dw.getDocumentDOM('document');
  11.   if (curDOM && (curDOM.getSelectedNode().nodeType == Node.TEXT_NODE)) {
  12.     var curSel = dw.getSelection();
  13.     document.theform.anchorname.value = curDOM.documentElement.outerHTML.slice(curSel[0],curSel[1]);
  14.   }
  15.   document.theform.anchorname.focus();
  16. }
  17.  
  18. //---------------    LOCAL FUNCTIONS   ---------------
  19.  
  20. function objectTag() {
  21.   // Return the html tag that should be inserted
  22.   return '<A NAME="' + document.forms[0].anchorname.value + '">';
  23. }
  24.  
  25.  
  26.  
  27.